package com.jy.admin.db.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.jy.admin.db.dao.SmsSendChannelDao;
import com.jy.admin.db.entity.SmsSendChannelEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * User: anonymous
 * Date: 2021-12-10
 * Time: 14:58:47.060
 */

@Repository
public class SmsSendChannelDaoImpl extends AbstractBaseMapper<SmsSendChannelEntity> implements SmsSendChannelDao {

    @Override
    public SmsSendChannelEntity getByChannelCode(String channelCode) {
        Map<String, Object> params = new HashMap<>();
        params.put("channelCode", channelCode);
        return getSqlSession().selectOne(this.getStatement("getByChannelCode"), params);
    }

    @Override
    public List<SmsSendChannelEntity> getAllChannels() {
        return getSqlSession().selectList(this.getStatement("getAllChannels"));
    }
}